/** * @license * Copyright 2017 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AfterViewInit, ElementRef, EventEmitter, OnChanges, QueryList, SimpleChanges } from "@angular/core"; import { SelectionService } from "../../_services/selection.service"; import { Node } from "apicurio-data-models"; /** * Base class for all inline editors. */ export declare abstract class AbstractInlineEditor { protected selectionService: SelectionService; static s_activeEditor: any; enabled: boolean; labelClass: string; inputClass: string; formClass: string; baseNode: Node; nodePath: string; onChange: EventEmitter; editing: boolean; inputFocus: boolean; /** * Current value in the edit area */ evalue: T; protected constructor(selectionService: SelectionService); onStartEditing(): void; protected abstract initialValueForEditing(): T; onSave(): void; protected getValueForSave(): T; onCancel(): void; isEditedValueEmpty(): boolean; onInputKeypress(event: KeyboardEvent): void; onInputFocus(isFocus: boolean): void; protected isEscapeKey(event: KeyboardEvent): boolean; protected isEnterKey(event: KeyboardEvent): boolean; } /** * Base class for any inline editor that edits a single value of an arbitrary type. */ export declare abstract class AbstractInlineValueEditor extends AbstractInlineEditor implements OnChanges { value: T; noValueMessage: string; protected constructor(selectionService: SelectionService); ngOnChanges(changes: SimpleChanges): void; displayValue(): string; protected abstract formatValue(value: T): string; isEmpty(): boolean; protected initialValueForEditing(): T; } /** * Base class for any inline editor that is built on a single text input element. The template * must include an 'input' element named #newvalue. */ export declare abstract class TextInputEditorComponent extends AbstractInlineValueEditor implements AfterViewInit { input: QueryList; /** * C'tor. * @param selectionService */ protected constructor(selectionService: SelectionService); ngAfterViewInit(): void; isEmpty(): boolean; isEditedValueEmpty(): boolean; protected formatValue(value: string): string; protected getValueForSave(): string; } /** * Base class for any inline editor that is built on a single textarea element. The template * must include a 'textarea' element named #newvalue. */ export declare abstract class TextAreaEditorComponent extends TextInputEditorComponent { /** * C'tor. * @param selectionService */ protected constructor(selectionService: SelectionService); /** * Called when a keypress happens. * @param event */ onInputKeypress(event: KeyboardEvent): void; /** * Subclasses can override this to provide validation status of the current value. */ protected isValid(): boolean; }